﻿
@page "/Bas/SettlementAccount/Create"
@using nERP.ViewModel.Bas.SettlementAccountVMs
@using System.ComponentModel.DataAnnotations
@inherits BasePage

<div>
  <ValidateForm @ref="vform" Model="@Model" OnValidSubmit="@Submit" >
    <Row ItemsPerRow="ItemsPerRow.Two" RowType="RowType.Normal">
      <BootstrapInput @bind-Value="@Model.Entity.Code"/>
      <BootstrapInput @bind-Value="@Model.Entity.Name"/>
      <BootstrapInput @bind-Value="@Model.Entity.BeginAmount"/>
      <BootstrapInput @bind-Value="@Model.Entity.NowAmount"/>
      <Row ItemsPerRow="ItemsPerRow.One" ColSpan="2" RowType="RowType.Normal">
      <BootstrapInput @bind-Value="@Model.Entity.Remark"/>
      </Row>
    </Row>

    <div class="modal-footer table-modal-footer">
      <Button ButtonType="ButtonType.Submit" IsAsync="true" Text="@WtmBlazor.Localizer["Sys.Submit"]"/>
      <Button OnClick="OnClose" Text="@WtmBlazor.Localizer["Sys.Close"]"/>
    </div>

  </ValidateForm>

</div>



@code {
    [Parameter]
    public string id { get; set; }
    [Parameter]
    public string[] ids { get; set; }
    private SettlementAccountVM Model = new SettlementAccountVM();
    private ValidateForm vform { get; set; }
    private async Task Submit(EditContext context)
    {
                        
        
        await PostsForm(vform, "/api/Bas/SettlementAccount/Create", (s) => "Sys.OprationSuccess");
    }
    public void OnClose()
    {
        CloseDialog();
    }
    
    protected override async Task OnInitializedAsync()
    {
        
        

        await base.OnInitializedAsync();
    }
}
